package com.version1_3.service.implement;

import com.alibaba.fastjson.JSONArray;
import com.util.format.MapToJson;
import com.version1_3.dao.SubscriDao1_3;
import com.version1_3.service.SubscriService1_3;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by kuibu on 15/12/25.
 */
@Service
public class SubscriServiceImpl13 implements SubscriService1_3 {
    private static final Logger LOGGER = Logger.getLogger(SubscriServiceImpl13.class);

    @Autowired
    private SubscriDao1_3 subscriDao13;

    @Override
    public String changeUserFocus(JSONArray updateFocusJsonArray, int userId) {

        return new MapToJson("changeUserFocusResult", subscriDao13.changeUserFocus(updateFocusJsonArray, userId)).toJsonString();

    }

    /**
     * 订阅单独的三级分类
     */
    @Override
    public boolean subscriThirdType(int userId, int firstType, int thirdTypeId) {
        return subscriDao13.subscriThirdType(userId, firstType, thirdTypeId);
    }

    /**
     * 取消订阅单独的三级分类
     */
    @Override
    public boolean removeSubscri(int userId, int firstType, int thirdTypeId) {
        return subscriDao13.removeSubscri(userId, firstType, thirdTypeId);
    }
}
